package com.yunhe.authority.client;

import com.yunhe.authority.client.fallback.OptionFallbackFactory;
import com.yunhe.common.model.ResultObject;
import com.yunhe.common.model.base.Area;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import springfox.documentation.annotations.ApiIgnore;

@ApiIgnore
@FeignClient(value = "yh-option", fallbackFactory = OptionFallbackFactory.class)
@Component
public interface OptionClient {

    @RequestMapping(value = "/areas/{id}", method = RequestMethod.GET)
    ResultObject<Area> getAreaById(@PathVariable("id") Long id);

    @RequestMapping(value = "/areas/byTitle/{title}", method = RequestMethod.GET)
    ResultObject<Area> getAreaByTitle(@PathVariable("title") String title);
}
